package com.dailyblue.java.design.观察者模式;

public class LotteryBuyer extends Observer {

    private Subject subject;
    private Integer num;

    public LotteryBuyer(Subject subject) {
        this.subject = subject;
        this.num = (int) (Math.random() * 33 + 1);
        //subject.registerObserver(this);
    }

    @Override
    public void update(String message) {
        System.out.println(message);
        System.out.println("我购买的是：" + num);
    }
}
